package br.com.util;

import java.util.Collection;
import java.util.Date;
import java.util.Map;

public class Utilitario {

	public static boolean isVazio(String valor) {

		return valor == null || (valor.trim()).length() == 0;
	}

	public static boolean isVazio(Object[] obj) {

		return obj == null || obj.length == 0;
	}

	public static boolean isVazio(Object obj) {

		return obj == null;
	}

	public static boolean isVazio(char valor) {

		Character character = new Character(valor);

		return isVazio(character.toString());

	}

	public static boolean isVazio(Collection<?> lista) {
		return lista == null || lista.isEmpty();
	}

	public static boolean isVazio(Map<?, ?> mapa) {
		return mapa == null || mapa.isEmpty();
	}

	public static boolean isVazio(Date date) {

		return date == null || (date.toString().trim()).length() == 0;
	}

	public static boolean isVazio(Double valor) {

		return valor == null || (valor.toString().trim()).length() == 0;
	}

	public static boolean isVazio(Integer valor) {

		return valor == null || (valor.toString().trim()).length() == 0;
	}

	public static boolean isVazio(Long valor) {

		return valor == null || (valor.toString().trim()).length() == 0;
	}
	
}
